const BASE_URL = '/'

module.exports = {
	outputDir: 'dist',
	publicPath: './',
	assetsDir: "static",
	lintOnSave: false, //关闭eslint
	configureWebpack: {
		externals: {
			"BMap": "BMap"
		}
	},
	devServer: {
		historyApiFallback: true,
		hotOnly: true,
		inline: true,
		stats: {
			colors: true
		},
		port: 8188,
		proxy: {
			// 匹配代理的url
			'/api': {
				// 目标服务器地址

				target: 'https://admin.hzcckj.cn/',
				//target: 'http://47.96.172.5:8080/',
				// 路径重写
				pathRewrite: {
					'^/api': ''
				},
				changeOrigin: true
			},
			'/b-h5': {
				// 目标服务器地址

				target: 'https://admin.hzcckj.cn/',
				//target: 'http://47.96.172.5:8082/',
				// 路径重写
				pathRewrite: {
					'^/b-h5': ''
				},
				changeOrigin: true
			}
		}
	},
	pages: {
		index: {
			// 应用入口配置，相当于单页面应用的main.js，必需项
			entry: 'src/main.js',
			template: 'public/index.html',
			filename: 'index.html',
		},
	},
	css: {
		loaderOptions: {
			postcss: {
				plugins: [
					require('postcss-pxtorem')({
						rootValue: 192, // 换算的基数
						selectorBlackList: [], // 忽略转换正则匹配项
						propList: ['*']
					})
				]
			}

		}
	}
}